package com.model;

/**
 * 二维点类，用于存储坐标和经纬度
 */
public class Point2D {
    public double x, y;          // 局部坐标
    public double longitude;     // 经度
    public double latitude;      // 纬度
    
    // 使用局部坐标构造
    public static Point2D fromLocalCoordinates(double x, double y) {
        Point2D point = new Point2D();
        point.x = x;
        point.y = y;
        return point;
    }
    
    // 使用经纬度构造
    public static Point2D fromLatLon(double longitude, double latitude) {
        Point2D point = new Point2D();
        point.longitude = longitude;
        point.latitude = latitude;
        return point;
    }
    
    // 私有构造函数，防止直接实例化
    private Point2D() {}
} 